/********************************************************************
	created:	2009/02/07
	created:	7:2:2009   0:13
	filename: 	qyCriticalSection.h
	author:		Xiong Jiayu
	copyright:  
	purpose:	
*********************************************************************/
#pragma once

#ifndef __QYCRITICALSECTION_H__
#define __QYCRITICALSECTION_H__

#include "qyThreadingCommon.h"

/*
===========================================
class qyCriticalSection
===========================================
*/
/*
class qyCriticalSection
{
public:
	qyCriticalSection();
	~qyCriticalSection();

	void Enter();
	void Leave();

protected:
	CRITICAL_SECTION	m_criticalSection;
};

//-----------------------------------------------------------------------
QY_INLINE qyCriticalSection::qyCriticalSection()
{
	::InitializeCriticalSectionAndSpinCount( &this->m_criticalSection, 1024 );
}

//-----------------------------------------------------------------------
QY_INLINE qyCriticalSection::~qyCriticalSection()
{
	::DeleteCriticalSection( &this->m_criticalSection );
}

//-----------------------------------------------------------------------
QY_INLINE void qyCriticalSection::Enter()
{
	::EnterCriticalSection( &this->m_criticalSection );
}

//-----------------------------------------------------------------------
QY_INLINE void qyCriticalSection::Leave()
{
	::LeaveCriticalSection( &this->m_criticalSection );
}
*/
#endif
